importScripts('./subworkers.js');

const subWorker = new SubWorker('grandson.js');

subWorker.onmessage = (ev) => {
  if (ev.data === 'pong') {
    postMessage('pong pong');
  }
};

onMessage = (ev) => {
  if (ev.data === 'ping'){
    console.log('p 2 c');
    subWorker.postMessage('ping ping');
  }
};
